package com.dal.rpc.core.common;


import lombok.*;

/**
 * @program: dal-springboot
 * @description: 请求出参
 * @author: jian
 * @create: 2021-11-17 11:33
 */
@Data
@Builder
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class RpcResponse {

    private String requestId;

    private Throwable error;

    private Object result;

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public void setError(Throwable error) {
        this.error = error;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public String getRequestId() {
        return requestId;
    }

    public Throwable getError() {
        return error;
    }

    public Object getResult() {
        return result;
    }

    public boolean isError() {
        return error != null;
    }

}
